package com.example.mybatis_demo.ctl;

import com.example.mybatis_demo.po.User;
import com.example.mybatis_demo.po.po.UserQuery;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.*;

import java.sql.Time;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Objects;

/**
 * @author dzh
 * @since 2023-06-28
 */
@RestController
@RequestMapping("user")
public class UserCtl {

    @GetMapping("{id}")
    public User user(@PathVariable("id") Long id) {
        User user = new User();
        user.setId(id);
        user.setBirthday(new java.sql.Date(System.currentTimeMillis()));
        return user;
    }

    @PostMapping("query")
    public Object query(@RequestBody UserQuery userQuery) {
        return userQuery;
    }
}
